package com.situ.junit;

import org.junit.Test;

import com.situ.domain.Car;
import com.situ.service.CarTreeSet;

public class CarTreeSetTest {
    CarTreeSet carTreeSet = new CarTreeSet();

    @Test
    public void listCarsTest() {
        for (Car car : carTreeSet.listCars()) {
            System.out.println(car);
        }
    }

    @Test
    public void addCar() {
        carTreeSet.listCars().add(new Car("test", 2.63));
        for (Car car : carTreeSet.listCars()) {
            System.out.println(car);
        }
    }

    @Test
    public void findcar() {
        String temp = "鲁B-K1P25";
        Car car = carTreeSet.findCar(temp);
        System.out.println(car);
    }

    @Test
    public void deleteCar() {
        for (Car car : carTreeSet.listCars()) {
            System.out.println(car);
        }
        System.out.println("************");
        carTreeSet.deleteCar(new Car("鲁B-K1P25", 2.26));
        for (Car car : carTreeSet.listCars()) {
            System.out.println(car);
        }
    }

}
